home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Utilities / PriorityMail / PriorityMail.app / installPrioritySendmail / removePrioritySendmail.csh < prev   
Encoding:
Linux/UNIX/POSIX Shell Script  |  1991-04-10  |  1.6 KB  |  47 lines

  1. #! /bin/csh -f
  2. # C. Oei
  3. set path = ( /usr/ucb /bin /usr/bin )
  4. if (`/usr/ucb/whoami` != 'root') then
  5.     echo must be root
  6.     exit 1
  7. endif
  8. if (! -w /usr/lib/) then
  9.     echo must be able to write into /usr/lib/
  10.     exit 1
  11. endif
  12. if (! -e /usr/lib/sendmail-0) then
  13.     echo PrioritySendmail does not seem to be installed
  14.     echo -n 'shall I try to restore preInstallation configuration (put it back to stock configuration)? (y/n) [n] '
  15.     set x = $<
  16.     if ($x != 'y') exit 1
  17.     what /usr/lib/.sendmail-backup | grep -i -s charles_oei
  18.     set whatStatus = $status
  19.     set stockRestoreError=0
  20.     if ((-e /usr/lib/.sendmail-backup) && ($whatStatus)) then
  21.     rm /usr/lib/sendmail
  22.     mv /usr/lib/.sendmail-backup /usr/lib/sendmail
  23.     /etc/chown 0.0 /usr/lib/sendmail
  24.     chmod 4551 /usr/lib/sendmail
  25.     echo /usr/lib/sendmail is restored to stock 2.0 conditions
  26.     else
  27.     echo 'cannot restore /usr/lib/sendmail'
  28.     echo 'get a fresh one from a stock 2.0 release disk'
  29.     echo 'install w/ the following permissions...'
  30.     echo '    -r-sr-x--x root wheel 81920 Nov 11 17:55 /usr/lib/sendmail*'
  31.     echo '[# /etc/chown 0.0 /usr/lib/sendmail ]'
  32.     echo '[# /bin/chmod 4551 /usr/lib/sendmail ]'
  33.     set stockRestoreError=1
  34.     endif
  35.     if ($stockRestoreError) exit 1
  36.     echo proper restoration from stock 2.0 configuration successful
  37.     exit 0
  38. endif
  39. if (! -e /usr/lib/.sendmail-backup) then
  40.     ln /usr/lib/sendmail-0 /usr/lib/.sendmail-backup >& /dev/null ###
  41. endif
  42. mv /usr/lib/sendmail-0 /usr/lib/sendmail >& /dev/null ###
  43. /etc/chown 0.0 /usr/lib/sendmail
  44. chmod 4551 /usr/lib/sendmail
  45. echo PrioritySendmail is removed
  46. exit 0
  47.